<template>
  <div class="home-container">
    <h1 class="home-title">列表</h1>
    <div class="button-container">
      <button @click="goToArticles" class="nav-button article-button">文章</button>
      <button @click="goToMovies" class="nav-button movie-button">电影</button>
      <button @click="goToProducts" class="nav-button product-button">商品</button>
      <button @click="goToRepository" class="nav-button repository-button">仓库</button>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router';

const router = useRouter();

const goToArticles = () => {
  router.push('/articles');
};

const goToMovies = () => {
  router.push('/movies');
};

const goToProducts = () => {
  router.push('/products');
};

// 新增仓库跳转方法
const goToRepository = () => {
  window.open('https://gitee.com/rran99/001/tree/MA/08', '_blank');
};
</script>

<style scoped>
.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background-color: #f5f7fa;
}

.home-title {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: #2c3e50;
}

.button-container {
  display: flex;
  gap: 1.5rem;
}

.nav-button {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  font-weight: bold;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.nav-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.article-button {
  background-color: #3498db;
}

.movie-button {
  background-color: #e74c3c;
}

.product-button {
  background-color: #2ecc71;
}

/* 新增仓库按钮样式 */
.repository-button {
  background-color: #9b59b6;
}
</style>
import { defineComponent } from 'vue';

export default defineComponent({
  name: 'HomeView',
});


<style scoped>
.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh; /* 确保内容居中 */
  text-align: center;
  background-color: #f0f2f5;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

h1 {
  color: #333;
  margin-bottom: 30px;
  font-size: 2.5em;
}

.navigation-links {
  display: flex;
  gap: 20px;
}

.nav-button {
  display: inline-block;
  padding: 15px 30px;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-size: 1.2em;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-button:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
}

.nav-button:active {
  background-color: #004085;
  transform: translateY(0);
}
</style>